package kz.pompei.OneGwt.ifaces.util;

import com.google.gwt.user.client.rpc.AsyncCallback;

public abstract class Comeback<T> implements AsyncCallback<T> {
  @Override
  public void onFailure(Throwable caught) {
    beforeCome();
  }
  
  @Override
  public void onSuccess(T result) {
    beforeCome();
    result( result );
  }
  
  protected abstract void result(T result);
  
  protected void beforeCome() {}
}
